package com.itzhigui.order.service;

import com.itzhigui.common.entity.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 作为feign客户端
 *
 * @author java1412
 * @since 2023-10-30 15:47:59
 */
// value属性的值是nacos注册中心注册的名称
@FeignClient(value = "mall-goods")
public interface GoodsService {
    // 编写一个远程调用抽象方法
    @GetMapping("/api/v1/goods/findByGoodsId")
    public Goods findByGoodsId(@RequestParam("goodsId") int goodsId);

    // 测试负载均衡
    @RequestMapping(value = "/api/v1/goods/findClusterName")
    public String findClusterName();
}
